<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>指定元素</title>
</head>
<body>
    <div id="div1">
        <p>JavaScript程序设计</p>
        <p id="p1">什么是JavaScript </p> 
        <p>JavaScript是一门功能强大的编程语言</p>
        <p>第一部分JavaScript概述 </p>  
        <p> JavaScript的发展历史 </p>
    </div>
<script>
    function delp(){
        var parent=document.getElementById("div1");
        var child=document.getElementById("p1");
        parent.removeChild(child);
    }
</script>
    <input type="button" value="删除p元素" onclick="delp()"/>
</body>
</html>